package window.utils;

import com.sun.java.swing.plaf.windows.WindowsFileChooserUI;

import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxRenderer;
import java.awt.*;

public class changeListColor extends DefaultListCellRenderer {

    @Override
    public Component getListCellRendererComponent(JList jList, Object o, int index, boolean b, boolean b1) {
        super.getListCellRendererComponent(jList,o,index,b,b1);
        Color background = Color.WHITE;
        if(!b){
            if (index%2 == 0) {
                background = Color.WHITE;
                this.setBackground(background);
            }
            else{
                background = new Color(242,242,242,242);
                this.setBackground(background);
            }
        }
        return this;
    }
}
